<!--
 * @Author: wangdazhuang
 * @Date: 2024-08-19 11:54:17
 * @LastEditTime: 2025-01-21 11:38:15
 * @LastEditors: ziqi jhzq12345678
 * @Description: 
 * @FilePath: /pornhub_app/web/index.html
-->
<!DOCTYPE html>
<html>
	<head>
		<!--
    If you are serving your web app in a path other than the root, change the
    href value below to reflect the base path you are serving from.

    The path provided below has to start and end with a slash "/" in order for
    it to work correctly.

    For more details:
    * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base

    This is a placeholder for base href that will be replaced by the value of
    the `--base-href` argument provided to `flutter build`.
  -->
		<base href="$FLUTTER_BASE_HREF" />

		<meta charset="UTF-8" />
		<meta content="IE=Edge" http-equiv="X-UA-Compatible" />
		<meta name="description" content="A new Flutter project." />
		<meta
			name="viewport"
			content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=fill"
		/>
		<meta name="theme-color" content="#111111" />
		<!-- iOS meta tags & icons -->
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<meta name="apple-mobile-web-app-title" content="pornhub_app" />
		<link rel="apple-touch-icon" href="logo.png" />

		<!-- Favicon -->
		<link rel="icon" type="image/png" href="logo.png" />

		<style>
			body {
				background-color: #111111;
			}
			@-webkit-keyframes spin {
				0% {
					transform: rotate(0);
				}
				100% {
					transform: rotate(360deg);
				}
			}
			@-moz-keyframes spin {
				0% {
					-moz-transform: rotate(0);
				}
				100% {
					-moz-transform: rotate(360deg);
				}
			}
			@keyframes spin {
				0% {
					transform: rotate(0);
				}
				100% {
					transform: rotate(360deg);
				}
			}
			.spinner {
				position: fixed;
				top: 0;
				left: 0;
				width: 100%;
				height: 100%;
				z-index: 1003;
				background: #111111;
				overflow: hidden;
			}
			.spinner .blob:first-child {
				display: block;
				position: relative;
				left: 50%;
				top: 50%;
				width: 150px;
				height: 150px;
				margin: -75px 0 0 -75px;
				border-radius: 50%;
				box-shadow: 0 3px 3px 0 rgba(255, 56, 106, 1);
				transform: translate3d(0, 0, 0);
				animation: spin 2s linear infinite;
			}
			.spinner .blob:first-child:after,
			.spinner .blob:first-child:before {
				content: "";
				position: absolute;
				border-radius: 50%;
			}
			.spinner .blob:first-child:before {
				top: 5px;
				left: 5px;
				right: 5px;
				bottom: 5px;
				box-shadow: 0 3px 3px 0 rgb(255, 228, 32);
				-webkit-animation: spin 3s linear infinite;
				animation: spin 3s linear infinite;
			}
			.spinner .blob:first-child:after {
				top: 15px;
				left: 15px;
				right: 15px;
				bottom: 15px;
				box-shadow: 0 3px 3px 0 rgba(61, 175, 255, 1);
				animation: spin 1.5s linear infinite;
			}
		</style>

		<title>pornhub_app</title>
		<link rel="manifest" href="manifest.json" />

		<script>
			// The value below is injected by flutter build, do not touch.
			const serviceWorkerVersion = null;
		</script>
		<script src="./hls.js" type="application/javascript"></script>
		<!-- <script src="flutter_bootstrap.js" async></script> -->
		<!-- <script src="main.dart.js" type="application/javascript"></script> -->

		<!-- This script adds the flutter initialization JS code -->
		<script src="flutter.js" defer></script>
	</head>
	<body>
		<div id="app_splash">
			<div class="spinner" id="loading_start">
				<div class="blob blob-0"></div>
				<div class="blob blob-1"></div>
				<div class="blob blob-2"></div>
				<div class="blob blob-3"></div>
				<div class="blob blob-4"></div>
				<div class="blob blob-5"></div>
			</div>
		</div>
		<script>
			window.addEventListener("load", function (ev) {
				let loading = document.querySelector("#loading_start");
				// Download main.dart.js
				_flutter.loader.loadEntrypoint({
					serviceWorker: {
						serviceWorkerVersion: serviceWorkerVersion,
					},
					onEntrypointLoaded: function (engineInitializer) {
						engineInitializer.initializeEngine().then(function (appRunner) {
							appRunner.runApp();
							loading.remove();
						});
					},
				});
				// .then(function (_) {
				// 	const flutterRoot = document.getElementsByTagName("flt-glass-pane").item(0);
				// 	flutterRoot.addEventListener("touchstart", (e) => {
				// 		if (e.pageX > 24 && e.pageX < window.innerWidth - 24) return;
				// 		e.preventDefault();
				// 	});
				// });
			});
			if ("serviceWorker" in navigator) {
				window.addEventListener("flutter-first-frame", function () {
					var splash = document.getElementById("app_splash");
					if (splash) {
						splash.remove();
					}
					navigator.serviceWorker.register("flutter_service_worker.js");
				});
			}

			document.addEventListener(
				"touchstart",
				(startEvent) => {
					if (startEvent.touches.length > 1) return;
					startEvent.preventDefault();
				},
				{ passive: false }
			);
		</script>
	</body>
</html>
